package com.hengpeng.itfinbase.idAssign;

import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.hengpeng.common.persist.OperateLogListener;
import com.hengpeng.common.persist.entity.AbstractEntity;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputType;

/**
 * <pre>
 * 包含自定义分配主键的实体类型抽象类,如果不要自定义分配,可以不用继承改基类
 * </pre>
 * @author linriqing
 * @version 1.0, 2010-7-6
 */
@MappedSuperclass
@Inheritance(strategy = InheritanceType.JOINED)
@EntityListeners(OperateLogListener.class)
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public abstract class AbstractAssign16IdEntity extends AbstractEntity
{
	private static final long serialVersionUID = 6757814772463743205L;

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "com.hengpeng.itfinbase.idAssign.IdGenerator", parameters = { @Parameter(name = "idLength", value = "16") })
	@GeneratedValue(generator = "idGenerator")
	@HtmlInput(type = HtmlInputType.ID)
	private Long id;

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}
}
